package com.jfinal.weixin.interceptor;

import javax.servlet.http.Cookie;

import com.jfinal.aop.Interceptor;
import com.jfinal.aop.Invocation;
import com.jfinal.core.Controller;
import com.jfinal.kit.StrKit;
import com.jfinal.weixin.sdk.api.JsTicketApi;
import com.jfinal.weixin.sdk.api.JsTicketApi.JsApiType;

public class JSTicketInterceptor implements Interceptor {

	public void intercept(Invocation ai) {
		Controller c = ai.getController();
		c.setAttr("jsticket", JsTicketApi.getTicket(JsApiType.jsapi));
		ai.invoke();
	}

}
